%%%-------------------------------------------------------------------
%% @doc network_app
%% @end
%%%-------------------------------------------------------------------

-module(network_app).
-include_lib("game_log/include/log.hrl").

-export([start/0]).

%% @doc 启动ranch进行game端网络监听
start() ->
    ?LOG_INFO("============================ NETWORK START ============================"),
    ServPort = config:get(serv_port),
%%    TransOpts = #{port => ServPort},
    TransOpts = [{port, ServPort}],
    ProtoOpts = #{},
    ?LOG_DEBUG("ServPort ~p", [ServPort]),
    {ok, _} = ranch:start_listener(network_game, ranch_tcp, TransOpts, game_protocol, ProtoOpts),
    ?LOG_DEBUG("ServPort2 ~p", [ranch:get_port(network_game)]),
    ?LOG_INFO("============================ NETWORK DONE ============================"),
    ok.

